# Lucid is (C) Copyright 2006-2007 by Infiscape Corporation
#
# This file is part of Lucid, a PyOpenSG example application.
#
# Lucid is free software; you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
#
# Lucid is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License along with
# this program.  If not, see <http://www.gnu.org/licenses/>.

import lucid.core

class ViewPluginsHolder(object):
   """ Class to hold view plugins for others to use. 
   @var mViewPlugins: Map plugin name to plugin class.   
   """
   def __init__(self):
      self.mViewPlugins = {}
   
   def scan(self):      
      """ Look for view plugins and add them. """
      env = lucid.core.Environment()
      plugin_mgr = env.pluginManager
      self.mViewPlugins = plugin_mgr.getPlugins(lucid.core.IViewPlugin,returnNameDict=True)
      print "Found %s view plugins."%len(self.mViewPlugins)
